//https://www.dotcpp.com/oj/contest6308_problem6.html
package 题目集.数学;

import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;

public class 等差数列最少项2 {
    /**
     * 正解是通过最大公约数来求解。
     * 每一项与第一项的差一定是d的倍数，所以只要求出所有差的最大公约数即可。
     */
    static int n;
    static int[] diff;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int[] origin = new int[n];
        diff = new int[n];
        for (int i = 0; i < n; i++) {
            origin[i] = sc.nextInt();
        }
        Arrays.sort(origin);
        for (int i = 1; i < origin.length; i++) {
            diff[i] = origin[i] - origin[0];
        }
        int d = find();
        if (d==0){
            System.out.println(n);
            return;
        }
        int res = (origin[n - 1] - origin[0]) / d + 1;
        System.out.println(res);
    }

    /**
     * 寻找最小公差
     */
    public static int find() {
        int gcd = diff[n - 1];
        for (int i = diff.length - 2; i >= 1; i--) {
            gcd=gcd(gcd,diff[i]);
        }
        return gcd;
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

}
